<template>
  <el-card>
    <el-tabs v-model="activeName" class="demo-tabs">
      <el-tab-pane label="功能介绍" name="first">
        <el-collapse v-model="activeNames" accordion>
          <el-collapse-item
            :title="item.title"
            :name="item.id"
            v-for="item in featureData"
            :key="item.id"
          >
            <div v-html="item.content"></div>
          </el-collapse-item>
        </el-collapse>
      </el-tab-pane>
      <el-tab-pane label="作者" name="second">
        <div class="author-container">
          <div class="header">
            <el-avatar :src="avatarSrc" :size="60" class="avatar"></el-avatar>
            <div class="header-desc">
              <h3>大傻子</h3>
              <span>11111111111</span>
            </div>
          </div>
          <div class="info">1111</div>
        </div>
      </el-tab-pane>
    </el-tabs>
  </el-card>
</template>
 
<script setup>
import { ref, defineProps } from "vue";
import { getAvatar } from "@/hook/getAvatar";
const activeName = ref("first");
const { avatarSrc } = getAvatar();
const activeNames = ref("1");

const props = defineProps(["featureData"]);
</script>
 
<style lang="scss" scoped>
:deep(.el-collapse-item__header) {
  font-weight: bold;
}
.el-collapse-item {
  :deep(a) {
    color: #409eff;
    margin: 0 4px;
  }
}
.author-container {
  .header {
    display: flex;
    .avatar {
      width: 60px;
      height: 60px;
      border-radius: 50%;
    }
    .header-desc {
      margin-left: 12px;
      display: flex;
      flex-direction: column;
      justify-content: space-around;

      span {
        font-size: 14px;
      }
    }
  }
  .info {
    margin-top: 16px;
    line-height: 22px;
    font-size: 14px;
    text-indent: 26px;
  }
}
</style>